package com.zs.leymovie.flashview.effect;

import android.annotation.TargetApi;
import android.os.Build;
import android.support.v4.view.ViewPager.PageTransformer;
import android.view.View;

public class InRightDownTransformer implements PageTransformer {

	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	@Override
	public void transformPage(View view, float position) {
		int pageHeight = view.getHeight();
		if (position < -1) {
			view.setAlpha(1);
			view.setTranslationY(0);
		} else if (position <= 0) {
			view.setTranslationY(pageHeight * position);
			view.setAlpha(1 + position);

		} else if (position <= 1) {
			view.setTranslationY(view.getHeight() * position);
			view.setAlpha(1 - position);
		} else {
			view.setTranslationY(0);
			view.setAlpha(1);
		}
	}

}
